<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}古董展示{% endblock %}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css">
    <style>
        body {
            background-color: #f8f9fa;
            font-family: "SimSun", "STSong", serif;
            padding: 1rem;
        }

        .container {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            padding: 1rem;
            margin-bottom: 1rem;
        }

        .antique-card {
            border: none;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 1rem;
        }

        .card-img-container {
            height: 200px;
            overflow: hidden;
            background-color: #f8f9fa;
        }

        .card-img-container img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .card-body {
            padding: 1rem;
        }

        .card-title {
            font-size: 1.1rem;
            font-weight: bold;
            margin-bottom: 0.5rem;
        }

        .antique-number {
            color: #6c757d;
            font-size: 0.9em;
            margin-left: 0.5em;
        }

        .badge {
            font-size: 0.8rem;
            padding: 0.4em 0.6em;
            margin-right: 0.3rem;
            margin-bottom: 0.3rem;
        }

        .price {
            color: #dc3545;
            font-weight: bold;
            font-size: 1.1rem;
            margin: 0.5rem 0;
        }

        .btn-detail {
            width: 100%;
            padding: 0.5rem;
            font-size: 0.9rem;
            border-radius: 4px;
        }

        .section-title {
            font-size: 1.2rem;
            font-weight: bold;
            margin: 1rem 0;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid #dee2e6;
        }

        .gallery-item {
            margin-bottom: 1rem;
        }

        .description {
            line-height: 1.6;
            color: #495057;
        }

        .meta-info {
            font-size: 0.8rem;
            color: #6c757d;
            margin-top: 1rem;
            padding-top: 0.5rem;
            border-top: 1px solid #dee2e6;
        }

        .back-button {
            position: fixed;
            bottom: 1rem;
            right: 1rem;
            width: 3rem;
            height: 3rem;
            border-radius: 50%;
            background-color: #343a40;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            z-index: 1000;
        }
    </style>
</head>
<body>
    <div class="container">
        {% block content %}
        {% endblock %}
    </div>

    {% block back_button %}
    <a href="{% url 'antiques:list' %}" class="back-button">
        <i class="bi bi-arrow-left"></i>
    </a>
    {% endblock %}

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 创建图片查看器
            const imageViewer = document.createElement('div');
            imageViewer.className = 'image-viewer';
            imageViewer.style.cssText = `
                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: rgba(0, 0, 0, 0.8);
                display: flex;
                justify-content: center;
                align-items: center;
                z-index: 1000;
                cursor: pointer;
            `;
            document.body.appendChild(imageViewer);

            // 创建图片容器
            const imageContainer = document.createElement('div');
            imageContainer.style.cssText = `
                max-width: 90%;
                max-height: 90%;
                position: relative;
            `;
            imageViewer.appendChild(imageContainer);

            // 创建图片
            const fullImage = document.createElement('img');
            fullImage.style.cssText = `
                max-width: 100%;
                max-height: 100%;
                object-fit: contain;
            `;
            imageContainer.appendChild(fullImage);

            // 初始隐藏查看器
            imageViewer.style.display = 'none';

            // 为所有图片添加点击事件
            document.querySelectorAll('img[data-full-image]').forEach(img => {
                img.addEventListener('click', function(e) {
                    e.preventDefault();
                    e.stopPropagation();
                    fullImage.src = this.dataset.fullImage;
                    imageViewer.style.display = 'flex';
                });
            });

            // 点击查看器关闭
            imageViewer.addEventListener('click', function() {
                this.style.display = 'none';
            });
        });
    </script>

</body>
</html> 